# Contributor: Eivind Uggedal <eu@eju.no>
# Maintainer: Laurent Bercot <ska-devel@skarnet.org>
pkgname=s6-rc
pkgver=0.5.4.2
pkgrel=0
pkgdesc="Service manager for s6-based systems"
url=https://skarnet.org/software/s6-rc/
arch="all"
license="ISC"
options="!check"
makedepends="skalibs-dev>=2.14 execline-dev s6-dev>=2.12"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://skarnet.org/software/s6-rc/s6-rc-$pkgver.tar.gz"

build() {
	./configure \
		--enable-shared \
		--enable-static \
		--disable-allstatic \
		--libdir=/usr/lib \
		--libexecdir="/lib/$pkgname" \
		--with-dynlib=/lib
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

doc() {
	default_doc
	mkdir -p "$subpkgdir/usr/share/doc"
	cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname"
}

static() {
	default_static
	rmdir -p "$pkgdir"/usr/lib || :
}

sha512sums="
f04e94db957e6d0033e328cc63530f64c9db101815bcafdb00a23205f4e75039dd3e593f93d48e4d9877b0696ea734ca62f672d92ff31e4e07aa19d26d809443  s6-rc-0.5.4.2.tar.gz
"
